class Student {
    private String name;
    private int age;
    private String studentID;
    private String major;
    private double gpa;

    public Student(String name, int age, String studentID, String major, double gpa) {
        this.name = name;
        this.age = age;
        this.studentID = studentID;
        this.major = major;
        this.gpa = gpa;
    }
    public Student(String name, int age, String studentID) {
        this.name = name;
        this.age = age;
        this.studentID = studentID;
        this.major = "未指定";
        this.gpa = 0.0;
    }
    public void Info() {
        System.out.println("学生信息:");
        System.out.println("姓名: " + name);
        System.out.println("年龄: " + age);
        System.out.println("学号: " + studentID);
        System.out.println("专业: " + major);
        System.out.println("绩点: " + gpa);
    }

    public void enrollCourse(Course course) {
        System.out.println(name + "已注册课程: " + course.getCourseName());
    }

    public void study(Course course) {
        System.out.println(name + "正在学习"+ course.getCourseName()+"。学分为："+course.getCredit());
    }
}